package com.zkthink.clh.order.entity;


import cn.afterturn.easypoi.excel.annotation.Excel;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.zkthink.base.entity.Entity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import lombok.experimental.Accessors;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
import java.time.LocalDateTime;

import static com.baomidou.mybatisplus.annotation.SqlCondition.LIKE;
import static com.zkthink.utils.DateUtils.DEFAULT_DATE_TIME_FORMAT;

/**
 * <p>
 * 实体类
 * 车惠龙订单表
 * </p>
 *
 * @author chenke
 * @since 2022-04-24
 */
@Data
@NoArgsConstructor
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("chl_order")
@ApiModel(value = "ChlOrder", description = "车惠龙订单表")
@AllArgsConstructor
public class ChlOrder extends Entity<Long> {

    private static final long serialVersionUID = 1L;

    /**
     * 会员id
     */
    @ApiModelProperty(value = "会员id")
    @TableField("mid")
    @Excel(name = "会员id")
    private Long mid;

    /**
     * 订单编号
     */
    @ApiModelProperty(value = "订单编号")
    @Length(max = 32, message = "订单编号长度不能超过32")
    @TableField(value = "order_code", condition = LIKE)
    @Excel(name = "订单编号")
    private String orderCode;

    /**
     *订单状态：1-待付款 2-下单失败 3-已付款，4=退款 5=提现申请 6=提现通过
     */
    @ApiModelProperty(value = "订单状态：1-待付款 2-下单失败 3-已付款，4=退款 5=提现申请 6=提现通过 ")
    @NotNull(message = "订单状态：1-待付款 2-下单失败 3-已付款，4=退款 5=提现申请 6=提现通过" )
    @TableField("order_status")
    @Excel(name = "订单状态：1-待付款 2-下单失败 3-已付款，4=退款 5=提现申请 6=提现通过 ")
    private Integer orderStatus;

    /**
     * 订单类型 1-充值vip 2-充值消费金，3-入住费 ,4=购买服务 5=充值余额，6=退款，7=提现
     */
    @ApiModelProperty(value = "订单类型 1-充值vip 2-充值消费金，3-入住费 ,4=购买服务 5=充值余额，7=提现")
    @TableField("order_type")
    @Excel(name = "订单类型 1-充值vip 2-充值消费金，3-入住费 ,4=购买服务 5=充值余额，7=提现")
    private Integer orderType;

    /**
     * 下单账户
     */
    @ApiModelProperty(value = "下单账户")
    @Length(max = 255, message = "下单账户长度不能超过255")
    @TableField(value = "member_account", condition = LIKE)
    @Excel(name = "下单账户")
    private String memberAccount;

    /**
     * 订单金额
     */
    @ApiModelProperty(value = "订单金额")
    @NotNull(message = "订单金额不能为空")
    @TableField("order_sum")
    @Excel(name = "订单金额")
    private BigDecimal orderSum;

    /**
     * 支付金额
     */
    @ApiModelProperty(value = "支付金额")
    @NotNull(message = "支付金额不能为空")
    @TableField("pay_sum")
    @Excel(name = "支付金额")
    private BigDecimal paySum;

    /**
     * 下单时的备注
     */
    @ApiModelProperty(value = "下单时的备注")
    @Length(max = 65535, message = "下单时的备注长度不能超过65535")
    @TableField("notes")
    @Excel(name = "下单时的备注")
    private String notes;

    /**
     * 预支付id
     */
    @ApiModelProperty(value = "预支付id")
    @Length(max = 65535, message = "预支付id长度不能超过65535")
    @TableField("prepay_id")
    @Excel(name = "预支付id")
    private String prepayId;

    /**
     * 付款时间
     */
    @ApiModelProperty(value = "付款时间")
    @TableField("pay_time")
    @Excel(name = "付款时间", format = DEFAULT_DATE_TIME_FORMAT, width = 20)
    private LocalDateTime payTime;

    /**
     * 支付方式 1-微信支付 2-支付宝支付 3=余额
     */
    @ApiModelProperty(value = "支付方式 1-微信支付 2-支付宝支付 3=余额")
    @NotNull(message = "支付方式 1-微信支付 2-支付宝支付不能为空 ")
    @TableField("pay_channel")
    @Excel(name = "支付方式 1-微信支付 2-支付宝支付 3=余额")
    private Integer payChannel;

    /**
     * 支付单号
     */
    @ApiModelProperty(value = "支付单号")
    @Length(max = 128, message = "支付单号长度不能超过128")
    @TableField(value = "pay_num", condition = LIKE)
    @Excel(name = "支付单号")
    private String payNum;

    /**
     * 逻辑删除 1-删除 0-未删除
     */
    @ApiModelProperty(value = "逻辑删除 1-删除 0-未删除")
    @NotNull(message = "逻辑删除 1-删除 0-未删除不能为空")
    @TableField("is_delete")
    @Excel(name = "逻辑删除 1-删除 0-未删除")
    private Integer isDelete;

    /**
     * 是否已存在发票
     */
    @ApiModelProperty(value = "是否已存在发票")
    @TableField("is_invoice")
    @Excel(name = "是否已存在发票")
    private Integer isInvoice;

    /**
     * 当订单类型为1时,充值vip类型的id
     */
    @ApiModelProperty(value = "当订单类型为1时,充值vip类型的id")
    @TableField("product_id")
    @Excel(name = "当订单类型为1时,充值vip类型的id")
    private Long productId;

    /**
     * 购买个数
     */
    @ApiModelProperty(value = "当订单类型为1时,购买Vip个数")
    @TableField("love_num")
    @Excel(name = "当订单类型为1时,购买Vip个数")
    private BigDecimal loveNum;

    /**
     * 二维码核销
     */
    @ApiModelProperty(value = "二维码核销")
    @TableField("code_url")
    private String codeUrl;

    /**
     * 店铺id
     */
    @ApiModelProperty(value = "店铺id")
    @TableField("store_id")
    private Long storeId;

    /**
     * 核销状态 （1=待核销  2=已核销）
     */
    @ApiModelProperty(value = "核销状态 （1=待核销  2=已核销）")
    @TableField("examine")
    private Integer examine;


    /**
     * 消费金额
     */
    @ApiModelProperty(value = "消费金额")
    @TableField("coupons")
    private BigDecimal coupons;
    /**
     * 商品id
     */
    @ApiModelProperty(value = "商品id")
    @TableField("projectid")
    private Long projectid;
    /**
     * 手机号
     */
    @ApiModelProperty(value = "手机号")
    @TableField("phone")
    private String phone;
    /**
     * 退款时间
     */
    @ApiModelProperty(value = "退款时间")
    @TableField("tui_time")
    @Excel(name = "付款时间", format = DEFAULT_DATE_TIME_FORMAT, width = 20)
    private LocalDateTime tuiTime;
    /**
     * 核销时间
     */
    @ApiModelProperty(value = "核销时间")
    @TableField("shiyong_time")
    @Excel(name = "核销时间", format = DEFAULT_DATE_TIME_FORMAT, width = 20)
    private LocalDateTime shiyongTime;

    /**
     *车牌号
     */
    @ApiModelProperty(value = "车牌号")
    @TableField("licensePlate")
    private String licensePlate;

    @ApiModelProperty(value = "vip套餐id")
    @TableField("vip_id")
    private String vipId;


}
